1. Field of the Invention
Embodiments of the invention relate generally to the field of computing systems, and more particularly, to a method and apparatus to support legacy master boot record (MBR) partitions in a storage device.
2. Description of Relared Art
By the use of interface device cards, today's computer systems are increasingly capable of supporting more technologically advanced input/output (I/O) devices, as well as a greater number of I/O devices. An interface device card may be utilized to couple the rest of the computer system to one or more I/O devices. Examples of these I/O devices include, but are not limited to, storage devices such as hard disk drives, floppy disk drives, Compact Disk Read Only Memory (CD ROM) drives, Digital Video Disk (DVD) drives, as well as monitors, keypads, modems, printers, etc. The interface device cards that support these I/O devices, as well as other types of devices, often support newer firmware interface standards as well as legacy standards. In order to support these standards, the interface device cards typically have Extensible Firmware Interface (EFI) Option ROM (OPROM) and/or Legacy OPROM.
OPROM is typically firmware in the interface device card that is used to control a bootable peripheral I/O device. More particularly, OPROM includes pre-boot code that initializes a hardware device (e.g. an I/O device) that can be added to the computer system via the interface device card. The OPROM includes code to utilize the device.
Legacy OPROM is based on the original International Business Machine® (IBM) personal computer (PC)-Advanced Technology (AT) architecture, which is somewhat limited in its capabilities. For example, Legacy OPROM executes in 16-bit mode. On the other hand, newer firmware interface standards, implemented in EFI OPROM, have advantages over legacy OPROM, such as being faster, more reliable, etc.
In the case where a peripheral I/O device is a storage device, such as a disk drive, two different schemes are typically used for addressing individual blocks of data on a disk of the disk drive. When Legacy Operating Systems (OSs) are utilized, which in turn utilize the Legacy OPROM of the interface device, a legacy Cylinder, Head, Sector (CHS) scheme is used. In the CHS scheme, a block of data can be identified and addressed by the starting and ending cylinder (C), head (H) of the disk drive, and Sector (S). The CHS scheme is an older scheme of disk access and as technology advances is being replaced by a second simpler Logical Block Addressing (LBA) scheme.
In contrast, the LBA scheme uses a flat numbering scheme. The LBA scheme is typically used by newer firmware interfaces using EFI OPROM of the interface device card. For example, the LBA scheme is a method used with small computer system interface (SCSI) disk drives and is also used with newer operating systems. Both of these two different schemes are typically used for addressing individual blocks of data on a disk of a hard disk drive.
For example, typically on the first sector of the disk of a hard disk drive, a data structure known as the master boot record (MBR) is present. The MBR is created when the disk is initially partitioned and is updated thereafter to reflect new disk partitions. Also, the MBR is executed when a computer boots up. When the MBR is executed it begins the boot process by looking at a partition table to determine which partition is to be used for booting. It then transfers program control to the boot sector of that partition, which continues the boot process.
The MBR contains a table of partitions and entries for each partition. Each partition has partition entries related to the address and size of the particular partition, as well as other data. Each partition may have data fields related to legacy CHS partition data and LBA partition data. Thus, for each partition entry, the partition entry may have data in the CHS scheme and/or the LBA scheme.
Accordingly, Legacy boot code associated with a Legacy operating system can utilize the particular Legacy partition address data (i.e. CHS data) to find and load the boot sector of the active partition and non-Legacy boot code (e.g. associated with a device under the control of an interface device using a newer EFI standard) may utilize the LBA addressing scheme to use the particular LBA partition address data to find and load the boot sector of the active partition.
However, when an EFI partition utility creates a partition on the disk it will only fill in the known fields in the EFI partition address data field of the MBR of the disk for the particular partition. Particularly, it will only fill in the LBA address partition data for the particular partition. The LBA address is known since the EFI software interfaces are based on LBA. Unfortunately, the CHS fields (i.e. the legacy CHS partition data) are unknown and will be left blank for that particular partition.